package com.xteam.utils;

public class TemplateTools {
	
	private TemplateTools() {
	}

	public enum TemplateState {
		/**
		 * 草稿
		 */
		SKETCH(1, "草稿"),
		/**
		 * 驳回
		 */
		REJECT(2, "驳回"),
		/**
		 * 发行
		 */
		RELEASE(3, "发行"),
		/**
		 * 失效
		 */
		DISCARD(4, "失效");

		private final int index;
		private final String text;

		private TemplateState(int index, String text) {
			this.index = index;
			this.text = text;
		}

		public int getIndex() {
			return index;
		}

		public String getText() {
			return text;
		}

		public static TemplateState getTemplateState(int index) {
			TemplateState[] tss = TemplateState.values();
			for (TemplateState ts : tss) {
				if (ts.index == index) {
					return ts;
				}
			}
			return null;
		}
	}

}
